package org.example.util;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

/**
 * @Auther:Liu
 * @Testname:DateMetaObjectHandler
 * @Date:2025/8/4 10:49
 */
@Component
@Slf4j
public class DateMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        log.info("start insert fill....");
        this.strictInsertFill(metaObject, "updateTime", String.class, DateUtil.nowDate());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        log.info("start update fill....");
        this.strictUpdateFill(metaObject, "updateTime", String.class, DateUtil.nowDate());
    }
}
